<%@ page pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.base.DatabaseObject"%>
<%@page import="com.base.Config"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="com.utils.LOBs"%>
<%@page import="java.sql.Clob"%>
<%@include file="inc-header.jsp"%><!-- MAIN CONTENT -->
<div class="box bottom10">
	<%@include file="inc-nav-header.jsp"%>
	<%	
	String sPCatId = Utils.getParam(request, "pcatid", "0");
	String sCatId = Utils.getParam(request, "catid", "0");
	String sId = Utils.getParam(request, "id", "0");
	DatabaseObject category = contentDAO.getCategory(new BigDecimal(sPCatId));
	DatabaseObject category1 = contentDAO.getCategory(new BigDecimal(sCatId));
	DatabaseObject content = contentDAO.getContent(new BigDecimal(sId));
	
	String sClass1 = "class=\"active\"";
	String sClass2 = "class=\"active\"";
	if (category1 != null) sClass1 = "";
	
	%>
	<div class="tab2">
		<%@include file="dichvu-adv.jsp" %> >>
		<a href="football.jsp?act=dv"> Bóng đá </a>
		<%if (category != null) {%>
		>> <a href="football-sub.jsp?act=dv&pcatid=<%=category.getAttribute().get("ID") %>" <%=sClass1 %>> <%=category.getAttribute().get("NAME") %></a>
		<%}%>
		<%if (category1 != null) {%>
		>> <a href="football-sub.jsp?act=dv&pcatid=<%=sPCatId %>&catid=<%=category1.getAttribute().get("ID") %>" <%=sClass2 %>> <%=category1.getAttribute().get("NAME") %></a>
		<%}%>
	</div>
	<!--end .tab2-->
	<!-- BODY CONTENT -->
	<div class="box clearfix">
		<div class="table">
		    <table cellpadding="0" cellspacing="0" border="0" width="100%">
		        <tbody>
		        	<h2 class="clearfix"><a href="#" class="f1"> <strong> <%=content.getAttribute().get("name") %> </strong></a></h2>  
				</tbody>
				<%
					String str = LOBs.readClob((Clob)content.getAttribute().get("detail"));
					System.out.println("Str:"+str);
					String[] temp;
					String delimiter = "\n";
					temp = str.split(delimiter);
				String idXep_hang = "28844";
				if(sId.equals(idXep_hang))
				{
				%>
					<tr><td><h3><b>TT- Ðội - Vòng đấu - Điểm</b></h3></td></tr>
				<%
					for(int i =0; i<temp.length; i++)
					{%>
						<tr><td><%=i+1%> --<%=temp[i]%></td></tr>
					<%}%>
				<%}else{%>
				<%=content.getAttribute().get("detail") != null?LOBs.readClob((Clob)content.getAttribute().get("detail")).replaceAll("\n", "<br/>"):""%>
				<%}%>
			</table>
		</div><!--end .table-->
		<div class="box clearfix">
		    <p align="center" class="bottom10">
		        <img src="<%=content.getAttribute().get("preview_image") %>" alt="">
		    </p>
		</div><!--end .box-->
		</div>
	<div class="box clearfix">
		<div class="title">
			<h3 class="bg">
				<strong> Danh mục bóng đá</strong>
			</h3>
		</div>
		<!--end .title-->
		<ul class="list-dot"><%
		String catParentId = sPCatId;
		if (!StringTool.isEmptyOrNul(catParentId)) {
			ArrayList<DatabaseObject> categoryList = contentDAO.getCategory(catParentId, null);
			for (DatabaseObject cat : categoryList) {%>
			
			<li>
				<img src="images/icon-list.png" alt="<%=cat.getAttribute().get("NAME") %>">
				<a href="football-sub.jsp?act=dv&pcatid=<%=sPCatId %>&catid=<%=cat.getAttribute().get("ID") %>"> <%=cat.getAttribute().get("NAME") %> </a>
			</li>
		<%}}%>
		</ul>
	</div>
	<!-- END BODY CONTENT -->
</div>
<!--end .box bottom10-->
<%@include file="inc-nav-bottom.jsp"%>
<!-- END MAIN CONTENT -->
<%@include file="inc-footter.jsp"%>
